/**
 * DatabaseHelper.java [V 1.0.0]
 * classes : org.xiaocq.wordsgod.db.DatabaseHelper
 * xiaocq Create at 2012-6-23 下午9:18:17
 */
package org.xiaocq.wordsgod.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

/**
 * org.xiaocq.wordsgod.db.DatabaseHelper
 * 
 * @author Mystory Create at 2012-6-23 下午9:18:17
 */
public class DatabaseHelper extends SQLiteOpenHelper {
	public static final String DATABASE_NAME = "words.db";
	public static final int DATABASE_VERSION = 1;
	
	private static final String TAG = "DatabaseHelper";

	public DatabaseHelper(Context context) {
		super(context, DATABASE_NAME, null, DATABASE_VERSION);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		String createSQL = "CREATE TABLE " + DVocabulary.TABLE_NAME + " ( "
				+ DVocabulary._ID + " INTEGER PRIMARY KEY,"
				+ DVocabulary.ENGLISH + " TEXT," + DVocabulary.CHINESE
				+ " TEXT," + DVocabulary.UNIT + " INTEGER,"
				+ DVocabulary.CURRENT + " INTEGER," + DVocabulary.CORRECT
				+ " INTEGER," + DVocabulary.TOTAL_COUNT + " INTEGER,"
				+ DVocabulary.WRONG_COUNT + " INTEGER);";
		
		Log.d(TAG, createSQL);
		
		db.execSQL(createSQL);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		//do some stuff.
	}

}
